<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
 * CodeIgniter
 *
 * An open source application development framework for PHP 5.1.6 or newer
 *
 * @package        CodeIgniter
 * @author        ExpressionEngine Dev Team
 * @copyright    Copyright (c) 2008 - 2011, EllisLab, Inc.
 * @license        http://codeigniter.com/user_guide/license.html
 * @link        http://codeigniter.com
 * @since        Version 1.0
 * @filesource
 */

// ------------------------------------------------------------------------

/**
 * CodeIgniter Number Helpers
 *
 * @package        CodeIgniter
 * @subpackage    Helpers
 * @category    Helpers
 * @author        ExpressionEngine Dev Team
 * @link        http://codeigniter.com/user_guide/helpers/number_helper.html
 */

// ------------------------------------------------------------------------

function format_number($number = 0)
{
    if ($number >= 1000) {
        return number_format($number, 0, ',', '.');
    }
    return $number;
}

function format_price($price = 0, $currency = '')
{
    $ci =& CI();
    if ($currency == '') {
        $currency = $ci->settings->item('currency');
    }
    return format_number($price) . " $currency";
}


/* End of file number_helper.php */
/* Location: ./system/helpers/number_helper.php */